package mark.tom.friend.view.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.template.IViewHolder;
import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseViewHolder;
import mark.tom.friend.bean.vo.AppInfoVO;

public class MainListViewHolder extends BaseViewHolder implements IViewHolder {

    @Autowired ImageView appLogoImageView;
    @Autowired TextView appTitleTextView;

    public MainListViewHolder(View itemView) {
        super(itemView);
        // 绑定视图
        bindView(itemView);
    }

    private void bindView(View itemView) {
        ARouter.getInstance().inject(this, itemView);
    }

    public void applyView(AppInfoVO appInfo) {
        appLogoImageView.setImageDrawable(appInfo.getIcon());
        appTitleTextView.setText(appInfo.getAppName());
    }
}
